export const createDataStatItems = (num = 0) => [
  { icon: 'info', text: '信息总量', num, field: 'count' },
  { icon: 'reship', text: '转发总量', num, field: 'forward' },
  { icon: 'comment', text: '评论总量', num, field: 'comment' },
  { icon: 'praise', text: '点赞总量', num, field: 'like' },
  { icon: 'read', text: '阅读总量', num, field: 'read' },
  { icon: 'play', text: '播放总量', num, field: 'play' },
]

export const createColumns_hotReportArea = (vm) => {
  return [
    {
      title: '序号',
      align: 'center',
      width: 80,
      render: (h, params) => {
        const page = vm.hotReportArea.page
        return <div>{(page.pageNo - 1) * page.pageSize + params.index + 1}</div>
      },
    },
    { title: '省份', key: 'key', align: 'center' },
    {
      title: '占比',
      align: 'center',
      render(h, params) {
        const t = (vm.hotReportArea && vm.hotReportArea.totalCount) || 0
        if (t <= 0) return h('span', 0)
        return h('span', ((params.row.value / t) * 100).toFixed(2) + '%')
      },
    },
    { title: '报道数量', key: 'value', align: 'center' },
  ]
}

export const createForm = () => ({
  startTime: '',
  endTime: '',
  timeType: '本周', // 时间类型:全部,今天,昨天,本周,本月,本季,本年,近n天,近n周,近n月,近n季,近半年,自定义
})
